package com.qiaofang.collectmanage.stub.facade;

import com.qiaofang.collectmanage.stub.request.*;
import com.qiaofang.collectmanage.stub.response.*;
import com.qiaofang.common.response.CommonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @author li.yi
 * @date 2018年6月29日
 */
@FeignClient(name = "collectmanage",url="${feign.url.collectmanage}")
@RequestMapping("/collectrule")
@Api(tags = "collectrule", value = "采集规则接口集合")
public interface CollectRuleFacade {

	@RequestMapping(value = "/getCollectRuleById", method = RequestMethod.POST)
	@ApiOperation(value = "查询对象根据id", notes = "查询对象根据id")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "GetCollectRuleByUuidRequest") })
	public GetCollectRuleByUuidResponse getCollectRuleById(GetCollectRuleByUuidRequest request);


	@RequestMapping(value = "/getCollectRuleByCollectRule", method = RequestMethod.POST)
	@ApiOperation(value = "查询对象根据对象", notes = "查询对象根据对象")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "GetCollectRuleRequest") })
	public GetCollectRuleResponse getCollectRule(GetCollectRuleRequest request);


	@RequestMapping(value = "/saveCollectRule", method = RequestMethod.POST)
	@ApiOperation(value = "保存采集规则",notes = "保存采集规则")
	@ApiImplicitParams({@ApiImplicitParam(name="request",value="请求参数",dataType = "SaveCollectRuleRequest")})
	public CommonResponse saveCollectRule(SaveCollectRuleRequest request);


	@RequestMapping(value = "/updateCollectRule", method = RequestMethod.POST)
	@ApiOperation(value = "更新采集规则", notes = "更新采集规则")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "UpdateCollectRuleRequest") })
	public CommonResponse updateCollectRule(UpdateCollectRuleRequest request);


	@RequestMapping(value = "/removeCollectRule", method = RequestMethod.POST)
	@ApiOperation(value = "删除采集规则", notes = "删除采集规则")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "RemoveCollectRuleRequest") })
	public CommonResponse removeCollectRule(RemoveCollectRuleRequest request);


	@RequestMapping(value = "/listCollectRule", method = RequestMethod.POST)
	@ApiOperation(value = "获取多个对象不包含删的", notes = "获取多个对象")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "ListCollectRuleRequest") })
	public ListCollectRuleResponse listCollectRule(ListCollectRuleRequest request);


	@RequestMapping(value = "/searchCollectRulePage", method = RequestMethod.POST)
	@ApiOperation(value = "查询多个对象不包含删的分页列表", notes = "获取多个对象不包含删的分页列表")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "SearchCollectRulePageRequest") })
	public SearchCollectRulePageResponse searchCollectRulePage(SearchCollectRulePageRequest request);


	@RequestMapping(value = "/commonCityExtend", method = RequestMethod.POST)
	@ApiOperation(value = "对通用网站扩展城市", notes = "对通用网站扩展城市")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "CommonCityExtendRequest") })
	public CommonResponse commonCityExtend(CommonCityExtendRequest request);


	@RequestMapping(value = "/resolveRule", method = RequestMethod.POST)
	@ApiOperation(value = "解析采集规则", notes = "解析采集规则（1.找到频道；2.爬取第一页；3.解析第一页列表第一条；4.爬取解析详情页），带有titleLink，可以跳过列表页解析，直接进入详情页")
	@ApiImplicitParams({@ApiImplicitParam(name = "request", value = "请求参数", dataType = "ResolveRuleRequest") })
	public ResolveRuleResponse resolveRule(ResolveRuleRequest request);

	@RequestMapping(value = "/getCitys", method = RequestMethod.POST)
	@ApiOperation(value = "获取所有城市", notes = "获取所有城市")
	public GetCitysResponse getCitys();

	@RequestMapping(value = "/getSources", method = RequestMethod.POST)
	@ApiOperation(value = "获取所有采集网站", notes = "获取所有采集网站")
	public GetSourcesResponse getSources();

}
